import React, { Component } from "react";
import MyNavLink from "../../component/myNavLink";
import News from "./News";
import Message from "./Message";
import { Redirect, Switch, Route } from "react-router-dom";

export default class Home extends Component {
  render() {
    return (
      <div>
        <h1>Home</h1>
        <div>
          <MyNavLink to="/home/news">News</MyNavLink>
          <MyNavLink to="/home/message">Message</MyNavLink>
        </div>
        <div>
          <div className="container">
            <Switch>
              <Route path="/home/news" component={News} />
              <Route path="/home/message" component={Message} />
              <Redirect to="/home/news" />
            </Switch>
          </div>
        </div>
      </div>
    );
  }
}
